#pragma once 

#include <stdio.h>
#include <string.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <unistd.h>
#include <stdlib.h>

#define NONEFRESH 1<<1
#define FULREFRESH 1<<2
#define LINEREFRESH 1<<3

#define MAX 1024

struct IO_FILE
{
    int fileno;//文件描述符
    int flag;//打开方式
    char outBuff[MAX];//语言层输出缓冲区
    int buffSize;//输出缓冲区有效元素个数
    int refreshMed;
};

typedef struct IO_FILE MYFILE;

MYFILE* myfopen(const char *path, const char *mode);

void myfclose(MYFILE* fp);

void myfwrite(const void *ptr, size_t size, MYFILE *stream);

void myfflush(MYFILE* stream);
